<template>
  <div class="bg">
    <div class="top">
      <h3>精选榜单</h3>
      <!-- <p>更多榜单<van-icon name="arrow" /></p> -->
    </div>
    <ul>
      <li v-for="(item, index) in detail" :key="index">
        <p class="biao">
          <p>{{ item.name }}</p>
          <div>详情<van-icon name="arrow" /></div>
        </p>

        <div class="box">
          <p>NO.1</p>
          <div class="bottom">
            <img :src="item.performances[0].posterUrl" alt="" />
            <div class="right">
              <p>{{ item.performances[0].name }}</p>
              <!-- <p v-if="item.performances[0].brightPointList.title">{{ item.performances.brightPointList[0].title }}</p> -->
              <!-- <p v-if="!item.performances[0].brightPointList[0].title">{{ item.performances[0].brightPointList[0].title }}</p> -->
              <div class="price">
                <p class="colors">
                  ￥{{ item.performances[1].priceRange.split("-")[0] }}
                </p>
                <p>起</p>
              </div>
            </div>
          </div>
        </div>
        <div class="box">
          <p>NO.2</p>
          <div class="bottom">
            <img :src="item.performances[1].posterUrl" alt="" />
            <div class="right">
              <p>{{ item.performances[1].name }}</p>
              <div class="price">
                <p class="colors">
                  ￥{{ item.performances[1].priceRange.split("-")[0] }}
                </p>
                <p>起</p>
              </div>
            </div>
          </div>
        </div>
        <div class="box">
          <p>NO.3</p>
          <div class="bottom">
            <img :src="item.performances[2].posterUrl" alt="" />
            <div class="right">
              <p>{{ item.performances[2].name }}</p>
              <div class="price">
                <p class="colors">
                  ￥{{ item.performances[2].priceRange.split("-")[0] }}
                </p>
                <p>起</p>
              </div>
            </div>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script setup>
import axios from "@/api/axios.js";
import { ref } from "vue";
const getDetail = () =>
  axios.get(
    "https://show.maoyan.com/maoyansh/myshow/ajax/ranks?sellChannel=13&cityId=1&lng=0&lat=0",
    {}
  );
const detail = ref([]);
const tail = ref([]);

async function update() {
  const { data } = await getDetail();
  detail.value = data.data;
  // console.log("zhoumodetail", detail);
  // console.log("周tail", tail);
  // return detail;
}
update();
</script>

<style lang="scss" scoped>
.bg {
  .top {
    // line-height: 30rem;
    display: flex;
    justify-content: space-between;
    h3 {
      font-size: 18rem;
      font-weight: 700rem;
      line-height: 30rem;
      margin: 0 0 0 10rem;
      color: #523838;
    }
    p{
      height: 24rem;
      text-align: center;
      padding:  0 2rem;
      line-height: 24rem;
      background-color: #fff;
      border-radius: 12rem;
    }
  }
}

ul {
  display: flex;
}
li {
  width: 155rem;
  border-radius: 12rem;
  background-color: #fff;
  padding: 5rem;
  margin: 10rem 0 0 10rem;

  .biao {
    width: 150rem;
    font-size: 16rem;
    display: flex;
    font-weight: bold;
    justify-content: space-between;
    div{
      font-size: 12rem;
      color: #999;
    }
  }
  p {
    width: 80rem;
  }
  .box {
    width: 160rem;
    .bottom {
      display: flex;
      img {
        width: 42rem;
        height: 56rem;
      }
      .right {
        margin-top: 5rem;
        width: 96rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        p {
          width: 96rem;
          display: flex;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        .price {
          display: flex;
          margin-top: 5rem;
          color: #00000080;
          .colors {
            color: #f03d37;
          }
        }
      }
    }
  }
}

</style>
